<template>
	<view class="myMain">
		<view class="topBackG">
			<view class="userTitle">
				个人中心
			</view>
			<view class="loginArea">
				<view class="left_login">
					<view class="">
						<u-avatar size="120"  :src="defalutImg"></u-avatar>
					</view>
					<view class="login_status">
						未登录
					</view>
				</view>
				<view class="right_login">
					<u-image width="48rpx" height="48rpx" :src="qrIcon"></u-image>
				</view>
			</view>
			<view class="list_box">
				<view class="list_line" @click="nav('my')">
					<view class="list_line_left">
						<view class="">
							<u-image width="40rpx" height="38rpx" :src="userIcon"></u-image>
						</view>
						<view class="list_line_left_text">
							我的信息
						</view>
					</view>
					<view class="">
						<u-icon name="arrow-right" size="28" color="#CCCCCC"></u-icon>
					</view>
				</view>

				<view class="list_line" @click="nav('team')">
					<view class="list_line_left">
						<view class="">
							<u-image width="40rpx" height="38rpx" :src="team"></u-image>
						</view>
						<view class="list_line_left_text">
							我的团队
						</view>
					</view>
					<view class="">
						<u-icon name="arrow-right" size="28" color="#CCCCCC"></u-icon>
					</view>
				</view>

				<view class="list_line" @click="nav('dataBase')">
					<view class="list_line_left">
						<view class="">
							<u-image width="40rpx" height="38rpx" :src="dataBase"></u-image>
						</view>
						<view class="list_line_left_text">
							企业数据同步
						</view>
					</view>
					<view class="">
						<u-icon name="arrow-right" size="28" color="#CCCCCC"></u-icon>
					</view>
				</view>

				<view class="list_line" @click="nav('about')">
					<view class="list_line_left">
						<view class="">
							<u-image width="40rpx" height="38rpx" :src="about"></u-image>
						</view>
						<view class="list_line_left_text">
							关于我们
						</view>
					</view>
					<view class="">
						<u-icon name="arrow-right" size="28" color="#CCCCCC"></u-icon>
					</view>
				</view>


			</view>
		</view>
	</view>
</template>

<script>
	export default {
		// name:'my',
		data() {
			return {
				defalutImg: require('@/static/img/Login_logo.png'),
				qrIcon: require('@/static/img/QRcode_icon.png'),
				userIcon: require('@/static/icon/my_information@2x.png'),
				team: require('@/static/icon/my_team@2x.png'),
				dataBase: require('@/static/icon/Enterprise data synchronization@2x.png'),
				about: require('@/static/icon/About Us@2x.png'),
			}
		},
		computed: {

		},
		onReady() {
			// uni.setNavigationBarTitle({
			// 	title: '我的',
			// 	 backgroundColor: '#ff0000',
			// });
			let r = uni.getStorageSync('userinfo')
			if(r.user.avatar){
				this.defalutImg = r.user.avatar
			}
			//console.log(r);
		},
		methods: {
			nav(item) {
				if (item == 'my') {
					uni.redirectTo({
						url: '/pages/my/index'
					});
				}
				if (item == 'team') {
					console.log('22')
				}
				if (item == 'dataBase') {
					console.log('33')
				}
				if (item == 'about') {
					console.log('44')
				}
			},
			goLogin() {
				this.$u.route('/pages/login/index');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.myMain {
		position: fixed;
		background: linear-gradient(180deg, #E3FFF2 0%, #F1FFF8 20%, #F8F8F8 43%);
		height: 100vh;
		width: 100%;

		//height: 2000px;
		.topBackG {
			padding: 110rpx 0 0 0;

			//position: absolute;
			//overflow: hidden;
			.userTitle {
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 32rpx;
				color: #000000;
				line-height: 38rpx;
				text-align: center;
			}

			.loginArea {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 42rpx;
				padding: 0 24rpx;

				.left_login {
					display: flex;
					align-items: center;

					.login_status {
						padding-left: 20rpx;
						font-family: PingFang SC, PingFang SC;
						font-weight: 800;
						font-size: 48rpx;
						color: #212121;
						line-height: 56rpx;
					}

				}

				.right_login {}
			}

			.list_box {
				background-color: white;
				//	margin-top: ;
				margin: 40rpx 24rpx 0 24rpx;
				border-radius: 20rpx;

				.list_line {
					display: flex;
					padding: 28rpx 24rpx;
					align-items: center;
					justify-content: space-between;

					.list_line_left {
						display: flex;

						.list_line_left_text {
							font-family: PingFang SC, PingFang SC;
							font-weight: 500;
							font-size: 32rpx;
							color: #212121;
							line-height: 38rpx;
							margin-left: 30rpx;
						}
					}

					.list_line_right {}
				}
			}
		}
	}
</style>